<html>
<head>
<title>What Are Threads?</title>
</head>
<body>
<table width=100%>
<tr>
<td align=left>
<a href="index.html"><img src=../../images/PreviousArrow.gif width=26 height=26 align=bottom border=0 alt="Previous | "></a><a
href="simple.html"><img src=../../images/NextArrow.gif width=26 height=26 align=bottom border=0 alt="Next | "></a><a
href="../../index.html"><img src=../../images/WayUpArrow.gif width=26 height=26 align=bottom border=0 alt="Trail Map | "></a><a
href="../index.html"><img src=../../images/javaHeader.gif width=26 height=26 align=bottom border=0 alt="Writing Java Programs | "></a>
<td>
<td align=right>
<a href="index.html"><strong><em>Threads of Control</em></strong></a>
</td>
</tr>
</table>
<p>
<hr size=4>

<h2>
    What Are Threads?
</h2>
<p>
<blockquote>

All programmers are familiar with writing sequential programs.
You've probably written a program that displays "Hello World!",
or sorts a list of names, or computes a list of prime numbers.
These are sequential programs: each has a beginning, an end,
a sequence, and at any given time during the runtime of the program
there is a single point of execution.
<p>
A thread is similar to the sequential programs described above:
a single thread also has a beginning, an end, a sequence, and
at any given time during the runtime of the thread there is
a single point of execution. However, a thread itself is not
a program--it cannot run on its own--but runs within a program.
<hr>
<strong>Definition:</strong> A thread is a single sequential
flow of control within a program.
<hr>
<p>
There is nothing new in the concept of a single thread.
The real hoopla surrounding threads is not about a single sequential
thread, but rather about the use of multiple threads in a single
program all running at the same time and performing different tasks. 
<p>
The HotJava browser is an example of a multithreaded application; within
the HotJava browser you can scroll a page while it's downloading an applet or
image, play animation and sound concurrently, print a page in the
background while you download a new page, or watch three sorting
algorithms race to the finish. You are used to life operating in a
concurrent fashion...so why not your browser?


</blockquote>
<p>
<hr size=4>
<p>
<table width=100%>
<tr>
<td align=left>
<a href="index.html"><img src=../../images/PreviousArrow.gif width=26 height=26 align=top border=0 alt="Previous | "></a><a
href="simple.html"><img src=../../images/NextArrow.gif width=26 height=26 align=top border=0 alt="Next | "></a><a
href="../../index.html"><img src=../../images/WayUpArrow.gif width=26 height=26 align=top border=0 alt="Trail Map | "></a><a
href="../index.html"><img src=../../images/javaHeader.gif width=26 height=26 align=top border=0 alt="Writing Java Programs | "></a>
<td>
<td align=right>
<a href="index.html"><strong><em>Threads of Control</em></strong></a>
</td>
</tr>
</table>
</body>
</html>
